package it.e80.nm.bpm.model.entity;

import it.e80.nm.bpm.model.PaymentStatus;

import oracle.jbo.AttributeList;
import oracle.jbo.Key;
import oracle.jbo.domain.Date;
import oracle.jbo.domain.Number;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityDefImpl;
import oracle.jbo.server.EntityImpl;
import oracle.jbo.server.SequenceImpl;
import oracle.jbo.server.SessionImpl;
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Sat May 29 15:13:44 CEST 2010
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class PaymentImpl extends EntityImpl implements PaymentStatus {
    private static EntityDefImpl mDefinitionObject;

    /**
     * This is the default constructor (do not remove).
     */
    public PaymentImpl() {
    }

    /**
     * @param pyId key constituent

     * @return a Key object based on given key constituents.
     */
    public static Key createPrimaryKey(Number pyId) {
        return new Key(new Object[]{pyId});
    }

    /**
     * @return the definition object for this instance class.
     */
    public static synchronized EntityDefImpl getDefinitionObject() {
        if (mDefinitionObject == null) {
            mDefinitionObject = EntityDefImpl.findDefObject("it.e80.nm.bpm.model.entity.Payment");
        }
        return mDefinitionObject;
    }


    protected void create(AttributeList attributeList) {
        super.create(attributeList);
                SequenceImpl s =
                    new SequenceImpl("PY_ID_SEQ", getDBTransaction());
                setAttribute("PyId", s.getSequenceNumber());
        setAttribute("PyStatus", new Number(ACTIVE));
        setAttribute("PyCreatedDate", new Date(new java.sql.Date(new java.util.Date().getTime())));
    }
    
}
